﻿using System;
using System.IO;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Utilities
{
    public struct Path
    {
        public static string dbPath;
        public static string logPath;
    }

    public class CommonOperations
    {

        static public void DoSaveDocumentContent(Stream target, Stream source)
        {
            try
            {
                if (target != null)
                {
                    int nBytes = 2048;
                    int count = 0;
                    Byte[] arr = new Byte[nBytes];

                    do
                    {
                        count = source.Read(arr, 0, nBytes);
                        target.Write(arr, 0, count);

                    } while (count > 0);
                    target.Flush();
                }
            }
            finally
            {
                if (target != null)
                    target.Close();
                if (source != null)
                    source.Close();
            }
        }
    }
}
